package com.hjj.springboot.controller;

import com.hjj.springboot.entity.Promble;
import com.hjj.springboot.entity.R;
import com.hjj.springboot.service.IPrombleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/promble")
public class PrombleController {

    @Autowired
    private IPrombleService prombleService;

    @GetMapping("/findAll")
    public R findAll() {
        List<Promble> prombleList=prombleService.list();
        Map<String,Object> map = new HashMap<>();
        map.put("message",prombleList);
        return R.ok(map);
    }
}
